<?php
require_once  '../classes/ConnectionDB.php';
require_once  '../classes/ClasseManager.php';

$connection =ConnectionDB::getInstance()->connectToDB();
$codiceClasse = $_GET['codiceClasse'];
$result = ClasseManager::getInstance()->getStudentiByClasse($connection, $codiceClasse);

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <table border="1">
            <th>Nome</th>
            <th>Cognome</th>
            <th>Data Creazione</th>
            <th>Email</th>
          <?php
                $result->bind_result($nome, $cognome,$dataCreazione, $email);
                while($result->fetch())
                {
                    echo '<tr>';
                    echo '<td>'.$nome.'</td><td>' . $cognome .' </td><td>'. $dataCreazione . '</td><td>'. $email . '</td>';
                    echo '</tr>';
                }
                ?>
            </table>
    </body>
</html>
